package sipoc.messaging.component;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.integration.annotation.Header;
import org.springframework.integration.annotation.Payload;
import org.springframework.integration.annotation.ServiceActivator;
import org.springframework.stereotype.Component;

import sipoc.model.HbResponse;

@Component
public class SpainHbManager {

	private static final Logger LOGGER = LoggerFactory
			.getLogger(SpainHbManager.class);

	@ServiceActivator(inputChannel = "spainManagerChannel", outputChannel = "transformerChannel")
	public HbResponse get(@Header String deviceCode, @Payload Integer sequence) {
		LOGGER.info("Spain received hb with sequence {} for device {}",
				deviceCode, sequence);
		return new HbResponse("SP-HB OK");
	}
}
